<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center selectMaster_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub selectMaster_fd0_0'>
					<view class='flex flex-wrap align-center selectMaster_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  selectMaster_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<text class='selectMaster_fd0_0_c1'>选择师傅</text>
					<view class='flex flex-wrap align-center selectMaster_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view class="flex flex-wrap align-center justify-between benben-position-layout flex selectMaster_flex_1"
				:style="{top:(88+StatusBarRpx)+'rpx', }">
				<view>
					<benben-flex-tabs class-name='selectMaster_benbenTabsfd1_0' v-model="tabs" ref="benben_tabsfd1_0"
						select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false'
						:open-sticky='true' :top='88' :is-show-content='false' :scrollspy='false'
						:tabs-info.sync="tabsInfofd1_0" @change="getMasterWorkerFunc()">

						<scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
							class="benben-tabs" style="width:750rpx" :scroll-x="true"
							:scroll-left.sync="tabsInfofd1_0.moveX" scroll-with-animation="all .3s ease">
							<view class="benben-tabs-content" id="benben_tabsfd1_0-content">
								<view id="benben_tabsfd1_0-title"
									class="benben-tabs-title flex flex align-center justify-around">
									<view
										:class="{ 'checkTitlefd1_0': tabs == '1', 'flex flex-wrap align-center': true }"
										@tap="tabs = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

										<text>综合</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '2', 'flex flex-wrap align-center': true }"
										@tap="tabs = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

										<text>好评优先</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '3', 'flex flex-wrap align-center': true }"
										@tap="tabs = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

										<text>距离优先</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '4', 'flex flex-wrap align-center': true }"
										@tap="tabs = '4'" :id="`benben_tabsfd1_0-title-item-${'4'}`">

										<text>次数优先</text>

									</view>
								</view>
								<view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
									id="benben_tabsfd1_0-line"
									class="benben-tabs-line flex benben-flex-tabs-line selectMaster_linefd1_0"></view>
							</view>
						</scroll-view>

					</benben-flex-tabs>

				</view>

			</view>
			<view :style="{height: '88rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout selectMaster_flex_2">
				<template v-for='(item,key0) in masterList'>
					<view class='flex flex-wrap align-center flex-sub selectMaster_fd2_0' :key='key0'>
						<image class='selectMaster_fd2_0_c0' mode="aspectFit" :src='item.avatar'></image>
						<view class='flex flex-direction flex-wrap align-stretch flex-sub selectMaster_fd2_0_c1'>
							<text class='selectMaster_fd2_0_c1_c0'>{{item.real_name}}</text>
							<view class='flex flex-wrap align-center selectMaster_fd2_0_c1_c1'>
								<view class='flex flex-wrap align-center'>
									<template v-for="starNum in [1,2,3,4,5]">
										<image v-if="item.start_count >= starNum" :key="starNum"
											class='selectMaster_star1fd2_0_c1_c1_c0' mode="aspectFit"
											:src='STATIC_URL+"112.png"'></image>
										<image v-else :key="starNum" class='selectMaster_star1fd2_0_c1_c1_c0'
											mode="aspectFit" :src='STATIC_URL+"113.png"'></image>
									</template>
								</view>
								<text class='selectMaster_fd2_0_c1_c1_c1'>{{item.start_count}}</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text class='selectMaster_fd2_0_c1_c2_c0'>服务：</text>
								<text class='selectMaster_fd2_0_c1_c2_c0'>{{item.order_count}}</text>
								<text class='selectMaster_fd2_0_c1_c2_c0'>次</text>
							</view>
						</view>
						<view class='flex flex-direction flex-wrap align-end'>
							<view class='flex flex-wrap align-center selectMaster_fd2_0_c2_c0'>
								<text class='selectMaster_fd2_0_c2_c0_c0'>{{item.distance}}</text>
							</view>
							<button class='selectMaster_fd2_0_c2_c1' @tap.stop="throwDataFunc(item.id)">选择</button>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"tabsInfofd1_0": {
					lineleft: '',
					lineWidth: '',
					moveX: 0,
					scrollX: 0,
					PageScrollX: 0
				},
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"lng": "",
				"lat": "",
				"masterList": [],
				"masterWorker_id": "",
				"tabs": "1",
				"shopID": "",
				"order_sn": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {
				shopID,
				order_sn
			} = options
			if (shopID !== undefined) this.shopID = shopID
			if (order_sn !== undefined) this.order_sn = order_sn
			this.getMasterWorkerFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取选择师傅信息
			getMasterWorkerFunc() {
				this.minixPagingListsApi = global.apiUrls.post63f70f048d1db;
				this.pageingListApiMethod = 'post';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					sort_field: this.tabs,
					order_id: this.order_sn,
					// usermerchant_id: this.shopID,
					lng: this.lng,
					lat: this.lat
				}
				this.listData = [];
				this.masterList = this.listData;
				this.pagingListToggle();

			},
			//提交选择师傅
			async throwDataFunc(id) {
				//请求方法
				//数据验证

				let data63bbc43e8d3d3 = await this.$api.dbPost(global.apiUrls.post63bbc43e8d3d3, {
					aid: this.order_sn,
					jiedanren: id
				});
				if (!data63bbc43e8d3d3) return
				if (data63bbc43e8d3d3.data.code != 1) {
					this.$message.info(data63bbc43e8d3d3.data.msg);
					return
				}
				this.$urouter.navigateBack(1);
			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.selectMaster_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.selectMaster_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.selectMaster_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #333;
	}

	.selectMaster_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.selectMaster_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.selectMaster_flex_1 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 88rpx;
		background-size: 100% auto !important;
	}

	.selectMaster_linefd1_0 {
		background: rgba(213, 50, 21, 0);
		width: 100rpx;
		height: 8rpx;
		top: 80rpx;
		background-size: 100% auto !important;
	}

	.checkTitlefd1_0 {
		font-weight: 700 !important;
		font-size: 28rpx !important;
		color: rgba(213, 50, 21, 1) !important;
		background-color: rgba(255, 255, 255, 1) !important;
	}

	::v-deep .selectMaster_benbenTabsfd1_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		white-space: nowrap;
		text-align: center;
	}

	.selectMaster_flex_2 {
		padding: 24rpx 32rpx 0rpx 32rpx;
	}

	.selectMaster_fd2_0_c2_c1 {
		background: #d53215;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-size: 24rpx;
		color: #fff;
		width: 80rpx;
		height: 40rpx;
		line-height: 40rpx;
	}

	.selectMaster_fd2_0_c2_c0_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.selectMaster_fd2_0_c2_c0 {
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.selectMaster_fd2_0_c1_c2_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
		line-height: 33rpx;
	}

	.selectMaster_fd2_0_c1_c1_c1 {
		color: #E60036;
		font-size: 24rpx;
		font-weight: 400;
		margin: 0rpx 0rpx 0rpx 10rpx;
	}

	.selectMaster_star1fd2_0_c1_c1_c0 {
		height: 19rpx;
		margin: 0rpx 3rpx 0rpx 3rpx;
		width: 19rpx;
	}

	.selectMaster_star1fd2_0_c1_c1_c0 {
		width: 19rpx;
		height: 19rpx;
		margin: 0rpx 3rpx 0rpx 3rpx;
	}

	.selectMaster_fd2_0_c1_c1 {
		margin: 8rpx 0rpx 12rpx 0rpx;
	}

	.selectMaster_fd2_0_c1_c0 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.selectMaster_fd2_0_c1 {
		margin: 0rpx 16rpx 0rpx 24rpx;
	}

	.selectMaster_fd2_0_c0 {
		width: 80rpx;
		height: 80rpx;
		border-radius: 40rpx 40rpx 40rpx 40rpx;
	}

	.selectMaster_fd2_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 32rpx 24rpx 32rpx 24rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin-bottom: 16rpx;
	}
</style>